<template>
  <div>
    <!-- 出入口 -->
    <crkComponent
      :info="oneData"
      @close="emit('close')"
      @changeClose="changeClose"
      v-if="props.oneData.categoryId == '1846861780832358400'"
    ></crkComponent>
    <!-- 路 -->
    <roadComponent
      :info="oneData"
      @close="emit('close')"
      @changeClose="changeClose"
      v-if="props.oneData.categoryId == '1846861780832358401'"
    ></roadComponent>
    <!-- 普通监控点1 -->
    <ptjkdComponent
      :info="oneData"
      @close="emit('close')"
      @changeClose="changeClose"
      v-if="props.oneData.categoryId == '1896747873417170944'"
    >
    </ptjkdComponent>
    <!-- 智能设备1 -->
    <znsbComponent
      :info="oneData"
      @close="emit('close')"
      @changeClose="changeClose"
      v-if="props.oneData.categoryId == '1896747873421365248'"
    >
    </znsbComponent>
    <!-- 环境检测 -->
    <!-- <jksbComponent
      :info="oneData"
      @close="emit('close')"
      v-if="props.oneData.categoryId == '1846863886985334784'"
    ></jksbComponent> -->
    <!-- 公园1 -->
    <!-- <xxylComponent
      :info="oneData"
      @close="emit('close')"
      v-if="props.oneData.categoryId == '1846863886985334785'"
    ></xxylComponent> -->
    <xxylComponent
      :info="oneData"
      @close="emit('close')"
      @changeClose="changeClose"
      v-if="props.oneData.categoryId == '1846863886985334784'"
    ></xxylComponent>
  </div>
</template>



<script setup>
// 1846863886985334784	环境监测
// 1846863886985334785	休闲娱乐
// 1846861780832358400	社区服务
// 1846861780832358401	地理信息
// 1896747873417170944	监控普通
// 1896747873421365248	监控智能
import { ElMessage, ElMessageBox } from "element-plus";
const crkComponent = defineAsyncComponent(() =>
  import("./bqcomponents/crk.vue")
);
const roadComponent = defineAsyncComponent(() =>
  import("./bqcomponents/road.vue")
);
const jksbComponent = defineAsyncComponent(() =>
  import("./bqcomponents/jksb.vue")
);
const xxylComponent = defineAsyncComponent(() =>
  import("./bqcomponents/xxyl.vue")
);
const ptjkdComponent = defineAsyncComponent(() =>
  import("./bqcomponents/ptjkd.vue")
);
const znsbComponent = defineAsyncComponent(() =>
  import("./bqcomponents/znsb.vue")
);
const emit = defineEmits(["close"]);
const props = defineProps({
  oneData: Object,
  isd: {
    default: false,
    type: Boolean,
  },
});

const changeClose = (clused) => {
  useApi
    .post("/dynamicview/ar/optfavoriteTag", {
      tagId: props.oneData.tagId,
      ifFavor: clused == "1" ? 1 : 0,
    })
    .then((res) => {
      props.oneData.clused = clused == "1" ? true : false;
      window.parent.postMessage(
        {
          type: "iframe",
          data: {
            isrefresh: "load",
          },
        },
        "https://vp.bcdtech.cn:8787"
      );
    });
};

onMounted(() => {});
</script>

<style lang="scss" scoped>
/* 针对WebKit内核的自定义 */
::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}

::-webkit-scrollbar-track {
  background-color: #333333;
}

::-webkit-scrollbar-thumb {
  background-color: #51adeb;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #51adeb99;
}
</style>